<template>
  <div>
    <van-nav-bar
      :title="props.title"
      v-if="
        route.name == 'index' ||
        route.name == 'list' ||
        route.name == 'car' ||
        route.name == 'my'
      "
    />
    <van-nav-bar
    v-else
      :title="props.title"
      left-text="返回"
      left-arrow
      @click-left="onClickLeft"
    />
  </div>
</template>

<script setup>
import { useRoute, useRouter } from "vue-router";

const router = useRouter();
const route = useRoute();

const props = defineProps(["title"]);

const onClickLeft = () => history.back();
</script>

<style lang="scss" scoped></style>
